Connect and trigger a camera
A camera on the line reaches a flow through three nodes of its brand: one takes the picture, one receives it and one changes the camera's settings. In this guide you take control of an Omron camera, trigger it, see its pictures in the editor and change its exposure. The steps are the same for every brand of camera.
What you will learn
- How to find the cameras the controller sees and take control of one
- How to trigger a camera and receive its pictures in a flow
- How to change the exposure and other settings of the camera
Before you start
You need a GigE Vision camera on the controller's network, and the camera nodes of its brand in the palette: on a Rosepetal controller they come installed for Omron, Basler, Basler ToF, JAI, eBUS and Irayple. The basics of the editor are in Introduction to Node-RED. The flow starts with two inject nodes, «take a picture» and «apply settings», that stand for the signals of the line.
No camera at hand? The controller can emulate one: «Controller» → «Tools» → «Emulator» creates Omron, Irayple and Basler cameras that send images of a dataset of the project, and the camera nodes find them as they would a real camera. This guide was recorded that way.
1. Find the nodes of your camera
Type the brand of your camera in «filter nodes», here omron. Every brand has the same three nodes: omron-trigger takes a picture, omron-collector receives the pictures, and omron-config changes the camera's settings. For Basler they are basler-trigger, basler-collector and basler-config, and so on.

2. Add the trigger node
Drag omron-trigger onto the workspace, after the inject node «take a picture», and wire them. Every message that reaches it takes a picture with the cameras you choose; what the message carries does not matter.

3. See the cameras on the network
Double-click the node. «Available Cameras» lists the Omron cameras the controller finds on its network, with their MAC address, the network interface they are on and their status. The list is the same in the three nodes, and it refreshes every few seconds.

4. Leave «Omron Services» as it is
«Omron Services» starts and stops the service that finds the cameras and talks to them. On a controller with Omron cameras it reads «Running»; if it reads «Stopped», press «Start Omron» once and wait for the cameras to appear. Here the camera is emulated by the controller itself, which does that work, so the card reads «Stopped» and nothing needs pressing.

5. Take control of the camera
A camera that reads «Free» is not in use. Press «Start» in its row: the controller takes control of the camera, which can take up to ten seconds, and its status changes to «Controlled (ours)». «Controlled (other)» means another program holds the camera, and «No access» that its address does not suit the controller's network: «Fix IP» gives it one that does.

6. Choose the camera to trigger
Tick the camera in «Select» and click «Done». A trigger node can fire several cameras at once: tick each one.

7. Add the collector node
Click «Done», drag omron-collector onto the workspace and open it. It has no input: it sends a message for every picture the cameras ticked here take. Tick the same camera and click «Done».

8. Add a node to see the pictures
A picture arrives in msg.payload as raw pixels, which the debug panel cannot show. Every Rosepetal image node can: add rp-resize after the collector, set «Width» to 480 pixels, tick «Debug» and set «Debug width» to 400. The node shows each picture it passes on, under it, 400 pixels wide.

9. Deploy and take a picture
Click «Done» and «Deploy», and press the button of «take a picture». The camera takes a picture, the collector receives it and rp-resize shows it. The collector's status reads «subscribed 1»: it listens to one camera.

10. Add the config node
Drag omron-config after the inject node «apply settings» and wire them, then open it. Click «Add parameter», choose «Exposure Time (µs)» and write 5000: the time the sensor gathers light for each picture, in microseconds. Less time means a darker picture, and a sharper one when the product moves.

11. Choose the camera to configure
Tick the camera under «Available Cameras» and click «Done». Each message that reaches the node sends the parameters of its list to the cameras ticked here, and the node passes the message on.

12. Apply the settings and take another picture
Click «Done» and «Deploy». Press «apply settings»: the node's status reads «sent 1», and the camera keeps the new exposure. Press «take a picture» again: with a quarter of the light, 5000 µs instead of the 20000 µs it had, the picture comes out darker.

Good to know
- Every brand. The palette has a category per brand: «RP Omron», «RP Basler», «RP Basler ToF», «RP JAI», «RP eBUS» and «RP Irayple», each with a trigger, a collector and a config node that work as here. Some add settings of their own, such as the products of a time-of-flight camera (depth, intensity, point cloud): the help of each node, in the editor's help sidebar, lists them.
- Automatic exposure and gain. «Exposure Time» and «Gain» only take effect when the camera's automatic modes are off. Send
msg.parameters = { "ExposureAuto": "Off", "GainAuto": "Off" }to the config node once to turn them off. - Other settings. «Add parameter» also offers the width, height and offset of the image, which pause the pictures for about a second while they change, the gain in decibels and the acquisition mode. «Custom…» takes the name of any setting of the camera. A value can be a constant or come from
msg,floworglobal, andmsg.parametersadds or overrides settings for one message. - What the collector sends. Each message carries the picture in
msg.payload, as raw pixels in Rosepetal's image format, the camera inmsg.macand the time it was taken inmsg.timestamp. The Rosepetal image nodes read it there as they come; in the inferencer, set «Input field» topayload. - No camera at hand. «Controller» → «Tools» → «Emulator» creates emulated Omron, Irayple and Basler cameras that send images of a dataset of the project, on a trigger or on their own. Stop its scenario when you are done.
Next steps
Recorded on Rosepetal release 1.8.15, Node-RED 5.0.10, camera nodes for Omron 1.0.0-alpha.4.